/**
 * 
 */
package com.sci.web.daoimpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sci.web.bean.IndustryStaticsEnterprise;
import com.sci.web.bean.Options;
import com.sci.web.bean.Permission;
import com.sci.web.bean.StaticsEnterpriseByCityId;
import com.sci.web.bean.User;
import com.sci.web.bean.UserLoginTime;
import com.sci.web.dao.UserLoginDao;

/**
 * @author  BaiFuyou
 * @date: Sep 22, 2011 3:58:42 PM
 */
public class UserLoginDaoImpl extends SqlMapClientDaoSupport implements UserLoginDao {

	/* (non-Javadoc)
	 * @see com.sci.web.dao.UserLoginDao#isUserExist(com.sci.web.bean.User)
	 */
	public User isUserExist(User user) {
		// TODO Auto-generated method stub
		User u  = null;
		u = (User)super.getSqlMapClientTemplate().queryForObject("userlogin.getuser4login",user);
		return u;
	}

	@Override
	public void userLoginTime(UserLoginTime ult) {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().insert("userlogin.addnewuserlogintime", ult);
	}

	@Override
	public List<Options> getOneOptions() {
		// TODO Auto-generated method stub
		return super.getSqlMapClientTemplate().queryForList("systemmanage.getoneoptions");
	}

	@Override
	public Permission getPermission(int roleid) {
		// TODO Auto-generated method stub
		return (Permission)super.getSqlMapClientTemplate().queryForObject("systemmanage.getallrolepermission",roleid);
	}

	@Override
	public List<StaticsEnterpriseByCityId> getAllEnterpriseStatics() {
		// TODO Auto-generated method stub
		return super.getSqlMapClientTemplate().queryForList("userlogin.getstaticsenterbycity");
	}

	@Override
	public String getEnterpriseName(int uid) {
		// TODO Auto-generated method stub
		return (String)super.getSqlMapClientTemplate().queryForObject("userlogin.getenamebyuid",uid);
	}

	@Override
	public List<IndustryStaticsEnterprise> getAllIndustryStaticsEnterpriseForStatics() {
		// TODO Auto-generated method stub  
		return super.getSqlMapClientTemplate().queryForList("userlogin.getenterprise_industry_codestatistical");
	}

}
